import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../layout/Layout.vue'

const routes = [

  {
    path: '/register',
    name: 'Register',
    component: () => import("@/views/Register")
  },

  {
    path: '/login',
    name: 'Login',
    component: () => import("@/views/Login")
  },

  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:"/register",


    children:[
      {
        path: 'people',
        name: 'People',
        component: () => import("@/components/page/people_information")
      },
      {
        path: 'event',
        name: 'Event',
        component: () => import("@/components/page/event")
      },
      {
        path: 'family',
        name: 'Family',
        component: () => import("@/components/page/family_information")
      },
      {
        path: 'relation',
        name: 'Relition',
        component: () => import("@/components/page/reliationship")
      },
      {
        path: 'tree',
        name: 'Tree',
        component: () => import("@/components/page/family_tree")
      },
    ]

  },

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
